using System;
using System.Collections.Generic;
using System.Text;

namespace Dare.Utilities
{
    public class ArrayUtil
    {
        public static T[] GetRange<T>(T[] array, int startIndex, int count)
        {
            int copyLength = Math.Min(array.Length - startIndex, count);
            if (copyLength > 0)
            {
                T[] copy = new T[copyLength];
                Array.Copy(array, startIndex, copy, 0, copyLength);
                return copy;
            }
            else
            {
                return new T[0];
            }
        }
    }
}
